<?php
require_once ("../db/connectdatabase.php");

function insertRateBasicMort($id, $bank, $rate1, $rate2, $datecreate) {
	$con = new ConnectDB();
	$tbl = "rate_basic_mortgage";
	$fn = array('basic_id' => $id, 'bankid' => $bank, 'basic_rate1' => $rate1, 'basic_rate2' => $rate2, 'datecreate' => $datecreate);
	return $con -> insert($tbl, $fn);
}

function updateRateBasicMort($id, $bank, $rate1, $rate2, $datecreate) {
	$con = new ConnectDB();
	$tbl = "rate_basic_mortgage";
	$fn = array('bankid' => $bank, 'basic_rate1' => $rate1, 'basic_rate2' => $rate2, 'datecreate' => $datecreate);
	$condition = array('basic_id' => $id);
	return $con -> update($tbl, $fn, $condition);
}

function updateDisplayRateBasicMort($id, $isusse) {
	$con = new ConnectDB();
	$tbl = "rate_basic_mortgage";
	$fn = array('basic_isuse' => $isusse, 'datecreate' => time());
	$condition = array('basic_id' => $id);
	return $con -> update($tbl, $fn, $condition);
}

?>